/* ipp-usb - HTTP reverse proxy, backed by IPP-over-USB connection to device
 *
 * Copyright (C) 2020 and up by Alexander Pevzner (pzz@apevzner.com)
 * See LICENSE for license terms and conditions
 *
 * Program configuration
 */

package ippusb

// Configuration represents a program configuration
type Configuration struct {
	HTTPMinPort        int            // Starting port number for HTTP to bind to
	HTTPMaxPort        int            // Ending port number for HTTP to bind to
	DNSSdEnable        bool           // Enable DNS-SD advertising
	LoopbackOnly       bool           // Use only loopback interface
	IPV6Enable         bool           // Enable IPv6 advertising
	ConfAuthUID        []*AuthUIDRule // [auth uid], parsed
	LogDevice          LogLevel       // Per-device LogLevel mask
	LogMain            LogLevel       // Main log LogLevel mask
	LogConsole         LogLevel       // Console  LogLevel mask
	LogMaxFileSize     int64          // Maximum log file size
	LogMaxBackupFiles  uint           // Count of files preserved during rotation
	LogAllPrinterAttrs bool           // Get *all* printer attrs, for logging
	ColorConsole       bool           // Enable ANSI colors on console
	Quirks             QuirksSet      // Device quirks
}

// Conf contains a global instance of program configuration
var Conf = Configuration{
	HTTPMinPort:        60000,
	HTTPMaxPort:        60000,
	DNSSdEnable:        false,
	LoopbackOnly:       false,
	IPV6Enable:         false,
	ConfAuthUID:        nil,
	LogDevice:          LogDebug,
	LogMain:            LogDebug,
	LogConsole:         LogDebug,
	LogMaxFileSize:     256 * 1024,
	LogMaxBackupFiles:  5,
	LogAllPrinterAttrs: true,
	ColorConsole:       false,
}
